/**
 * Created by xiaomin on 2015/7/2.
 */

angular.module('MainController', [])
    .controller('MainController',['$rootScope','$state',function($rootScope,$state){
    //$rootScope.$on('$stateChangeStart',function(event, toState, toParams, fromState, fromParams){

        //console.log("from: "+fromState.name);
        //console.log("to: "+toState.name);
        //
        //// 如果是进入登录界面则允许
        //if(toState.name == 'login') return;
        //
        //// 如果用户不存在
        //console.log($rootScope.user);
        //if(!$rootScope.user){
        //    console.log("没有登录");
        //    event.preventDefault(); // 取消默认跳转行为
        //    $state.go("login",{from: fromState.name,w:'notLogin'});
        //    //$state.go(toState.name);
        //}



    //});
}]);
